package userService

import (
	"context"
	"h_rpcx/internet/service/BannerService"
	"h_rpcx/serve/user/business"
	"log"
)

func (u *UserService) GetBanner(ctx context.Context, req *BannerService.BannerReq, resp *BannerService.BannerResp) error {
	service := BannerService.BannerService{}
	serviceContext := business.NewServiceContext()
	db := serviceContext.DB
	All, err := service.GetAll(req, db)
	if err != nil {
		log.Println(err.Error())
	}
	resp.Banners = All.Banners
	return nil
}
